package cn.com.surker.sale.service;

import cn.com.surker.sale.entity.SaleContractStrengthPrice;
import cn.com.surker.sale.entity.SaleContractSubsidy;
import com.baomidou.mybatisplus.extension.service.IService;
import cn.com.surker.spring.RestResultDto;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.util.List;
import java.util.Map;

/**
* <p>
    * 销售合同补贴表 服务类
    * </p>
*
* @author admin
* @since 2024-07-09
*/
public interface SaleContractSubsidyBaseService extends IService<SaleContractSubsidy> {

    /**
     * 查询销售合同砼单价信息
     * @param contractId
     * @return
     */
    Map<String, List<SaleContractSubsidy>> findByContract(Long contractId);

    /**
     * 新增补贴价信息
     * @param orgId
     * @param contractId 合同ID
     * @param subsidyType 补贴方式(0:泵送方量1:运输方量,2:超时浇筑,3:润管剂/:润泵剂,4:接管补助,5：砂浆)
     * @param price 单价
     * @param takeTime 生效时间
     * @param countStere 计算方量
     * @param minStere 最小方量
     * @param num 次数
     * @param remark
     * @param creator
     * @return
     */
    Integer saveSubsidy(Long orgId, Long contractId, Integer subsidyType,Integer countType, Double price, Double taxPrice,
                        String takeTime, String remark, Double minStere, Double countStere, Integer num,
                        Long pumpNormId, Integer additionalCountType, String creator, String expireTime);
    /**
     *
     * @param id
     * @param contractId 合同ID
     * @param subsidyType 补贴方式(0:泵送方量1:运输方量,2:超时浇筑,3:润管剂/:润泵剂,4:接管补助,5：砂浆)
     * @param price 单价
     * @param takeTime 生效时间
     * @param countStere 计算方量
     * @param minStere 最小方量
     * @param num 次数
     * @param remark
     * @param creator
     * @return
     */
    Integer updateSubsidy(Long id, Long contractId, Integer subsidyType,Integer countType, Double price, Double taxPrice,
                          String takeTime, String remark, Double minStere, Double countStere, Integer num,
                          Long pumpNormId,Integer additionalCountType, String creator, String expireTime);

    /**
     * 禁用合同
     * @param id
     * @param status
     * @return
     */
    Integer updateStatus(Long id, Integer status, String creator);

    /**
     * 批量插入合同补贴
     * @param subsidyList
     * @param contractId
     * @param creator
     * @return
     */
    Integer saveBatchSubsidy(List<SaleContractSubsidy> subsidyList, Long contractId, String creator);

	/**
	 * 是否存在补贴
	 *
	 * @param conId
	 * @return
	 */
	boolean hasSubsidy(Long conId);

	List<SaleContractSubsidy> findSubsidy(Long orgId, Long conId, String takeTime);

}
